#data for this project were based upon the ANES version "ANES2016TimeSeries_20181218 " with 4270 respondents in the dataset. Code is verified to work on that data. 
rm(list = setdiff(ls(), lsf.str()))

#load ANES 2016 TIme Series data. 
#This code worked on the ANES version �NES2016TimSeries_201821
data <- read.dta13("Study 1/Original Data/anes_timeseries_2016.dta")
#select variables for "analysis dataset"
data <- data[,which(colnames(data)%in%c("V162031x", "V162333", "V162338", "V162334", "V162339", "V162335", "V162340", "V162336", "V162341", "V162337", "V162342", "V162239", "V162240", "V162241", "V162242", "V161342", "V161310b", "V161310c", "V161310d", "V161310e", "V161310f", "V161270", "V161267", "V161361x", "V161087", "V161086", "V161092", "V161093", "V161095", "V161096", "V162079", "V162078", "V162171", "V161158x", "V162034a"))]
#Save data
save(data, file="Study 1/Original Data (shareable)/Study1_US_ANES_analysisdata.Rdata")
